<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>DefenseDiceTest</title>

<link rel="stylesheet"
	href="http://code.jquery.com/qunit/qunit-1.15.0.css">
<script src="http://code.jquery.com/qunit/qunit-1.15.0.js"></script>

<script src="../../main/js/util/Logger.js"></script>

<script src="../../main/js/DefenseDice.js"></script>

<script>
    var LOGGER = new Logger();

    QUnit.test("DefenseDice properties", function(assert)
    {
        var dice = new DefenseDice(3);
        assert.ok(dice.getValue(0));
        assert.ok(dice.getValue(1));
        assert.ok(dice.getValue(2));
    });

    QUnit.test("DefenseDice.getBlankCount()", function(assert)
    {
        var dice = new DefenseDice(1);
        LOGGER.trace("dice = " + dice);
        if (dice.getValue(0) == DefenseValue.BLANK)
        {
            assert.equal(dice.getBlankCount(), 1);
        }
        else
        {
            assert.equal(dice.getBlankCount(), 0);
        }
    });

    QUnit.test("DefenseDice.getEvadeCount()", function(assert)
    {
        var dice = new DefenseDice(1);
        LOGGER.trace("dice = " + dice);
        if (dice.getValue(0) == DefenseValue.EVADE)
        {
            assert.equal(dice.getEvadeCount(), 1);
        }
        else
        {
            assert.equal(dice.getEvadeCount(), 0);
        }
    });

    QUnit.test("DefenseDice.getFocusCount()", function(assert)
    {
        var dice = new DefenseDice(1);
        LOGGER.trace("dice = " + dice);
        if (dice.getValue(0) == DefenseValue.FOCUS)
        {
            assert.equal(dice.getFocusCount(), 1);
        }
        else
        {
            assert.equal(dice.getFocusCount(), 0);
        }
    });
</script>
</head>
<body>
	<div id="qunit"></div>
</body>
</html>
